package com.dlyk.service.impl;

import com.dlyk.mapper.UserRoleMapper;
import com.dlyk.model.UserRole;
import com.dlyk.service.UserRoleService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class UserRoleServiceImpl implements UserRoleService {

    @Resource
    private UserRoleMapper userRoleMapper;

    /**
     * 添加用户角色
     */
    @Override
    public int addUserRole(UserRole userRole) {
        return userRoleMapper.insertSelective(userRole);
    }

    /**
     * 删除用户角色
     */
    @Override
    public int removeUserRoleByRoleIdAndUserId(Integer roleId, Integer userId) {
        return userRoleMapper.deleteUserRoleByRoleIdAndUserId(roleId, userId);
    }

}

